package tsg.shape;

import tsg.physics.Collision;
import tsg.util.Dimension;
import tsg.util.Point;


public abstract class Shape 
{
	/**
	 * 
	 */
	public boolean contains(Point point)
	{
		return Collision.pointLiesInRectangle(point, new Rectangle(_x, _y, _width, _height));
	}
	
	/**
	 * 
	 * @param point
	 */
	public void setPosition(Point point)
	{
		this.setX	(point.getX());
		this.setY	(point.getY());
	}

	
	/**
	 * 
	 * @param dimension
	 */
	public void setSize(Dimension dimension)
	{
		this.setWidth	(dimension.getWidth());
		this.setHeight	(dimension.getHeight());
	}
	
	/**
	 * 
	 * @return
	 */
	public int getX()
	{
		return _x;
	}
	
	/**
	 * 
	 * @param x
	 */
	public void setX(int x)
	{
		_x = x;
	}
	
	/**
	 * 
	 * @return
	 */
	public int getY()
	{
		return _y;
	}
	
	/**
	 * 
	 * @param y
	 */
	public void setY(int y)
	{
		_y = y;
	}
	
	/**
	 * 
	 * @return
	 */
	public int getWidth()
	{
		return _width;
	}
	
	/**
	 * 
	 * @param width
	 */
	public void setWidth(int width)
	{
		_width = width;
	}
	
	/**
	 * 
	 * @return
	 */
	public int getHeight()
	{
		return _height;
	}
	
	/**
	 * 
	 * @param height
	 */
	public void setHeight(int height)
	{
		_height = height;
	}
	

	
	
	private int _x 		= -1;
	private int _y 		= -1;
	private int _width 	= -1;
	private int _height = -1;
}
